// components/navbar/index.js
const app = getApp();
Component({
 /**
  * 组件的属性列表
  */
 properties: {
   // 这里定义了innerText属性，属性值可以在组件使用时指定
   name: {
     type: String,
     value: '养博城',
   },
   typeBar: {
     type: Number,
     value: 1,
   },
   share: {
     type: Number,
     value: 2
   },
   background: {
     type: String,
     value: '#666',
     observer(oldvalue,newvalue){
       //console.log(oldvalue,newvalue);
     }
   },
   address:{
     type:String,
     value:'定位'
   }
 },

 /**
  * 组件的初始数据
  */
 data: {
 
 },
 ready:function(){
   var that = this;
   that.setData({
     navbarHeight:app.globalData.navbarHeight + app.globalData.statusBarHeight
   })
   var showBack = getCurrentPages().length > 1 ? true : false
   this.setData({
    showBack:showBack
   })
   /*  wx.getSystemInfo({
      success: (result) => {
        console.log(result);
        const sys = result.system.toLowerCase().indexOf('ios') > -1 ? 'ios' : 'android';
           let menuButton = wx.getMenuButtonBoundingClientRect();
          this.globalData.menuTop = menuButton.top;
          this.globalData.menuHeight = menuButton.height;

          this.globalData.statusBarHeight = result.statusBarHeight;
          const sys = result.system.toLowerCase().indexOf('ios') > -1 ? 'ios' : 'android';
          this.globalData.system = sys;
          this.globalData.navbarHeight = sys === 'ios' ? 44 : 48;

          this.globalData.navHeight = this.globalData.navbarHeight + result.statusBarHeight + 1.5 * menuButton.height
          this.globalData.screenHeight = result.screenHeight; 
      },
  }) */
 },
 /**
  * 组件的方法列表
  */
 methods: {
  navBack:function(e){
    console.log(e);
    wx.navigateBack({
      delta: 1
    })
  
  }
 },
 
 
})